
#ifndef _CONFIGMANAGER_H_
#define _CONFIGMANAGER_H_

#include "common.h"

#include <map>
#include <string>

__BEGIN_NAMESPACE_DECL_

class ConfigManager
{
    public:
        static ConfigManager& getInstance();

        const char *getProperty (const char *property, const char *defaultValue);
        const char *getProperty (const char *property);
        bool        setProperty (const char *property, const char *value);
        bool        exists (const char *property) const;
        void        clear();
        bool        loadPropertiesFromFile (const char *filename);
        void        listProperties ();
        
    private:
        // This is a singleton; prevent 
        ConfigManager();
        ConfigManager(const ConfigManager&);

    private:
        static ConfigManager* _manager;
        std::map<std::string, std::string> _propertyMap;
};

__END_NAMESPACE_DECL_

#endif
